CustomObjectWrapper

Ecng.ComponentModel

Abstract base class that wraps an object and exposes its properties and events through ICustomTypeDescriptor interface. Wrapped properties are read-only and can be displayed in PropertyGrid or similar controls. The wrapper also implements INotifyPropertyChanged to support data binding scenarios.

Hereda de: Disposable

Implementa: INotifyPropertyChanged, ICustomTypeDescriptor

Constructores

CustomObjectWrapper
protected CustomObjectWrapper(T obj)
customObjectWrapper = CustomObjectWrapper(obj)

Abstract base class that wraps an object and exposes its properties and events through ICustomTypeDescriptor interface. Wrapped properties are read-only and can be displayed in PropertyGrid or similar controls. The wrapper also implements INotifyPropertyChanged to support data binding scenarios.

obj
The object to wrap.

Propiedades

Obj
public T Obj { get; }
value = customObjectWrapper.Obj

Parent object.

Métodos

OnGetEvents
protected virtual IEnumerable<EventDescriptor> OnGetEvents()
result = customObjectWrapper.OnGetEvents()

Gets the event descriptors from the wrapped object.

Devuelve: Collection of proxy event descriptors.

OnGetProperties
protected virtual IEnumerable<PropertyDescriptor> OnGetProperties()
result = customObjectWrapper.OnGetProperties()

Gets the property descriptors from the wrapped object.

Devuelve: Collection of read-only proxy property descriptors.

OnPropertyChanged
protected virtual void OnPropertyChanged(string name)
customObjectWrapper.OnPropertyChanged(name)

Call PropertyChanged event.

name
Member name.
ToString
public override string ToString()
result = customObjectWrapper.ToString()

Returns a string representation of the tuple, with values separated by commas.

Devuelve: A string representing the tuple's values.

Eventos

PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
customObjectWrapper.PropertyChanged += handler

PropertyChanged.